package com.algernoon.rpc.springrpc.rmi.hessian;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.remoting.caucho.HessianServiceExporter;

@Configuration
public class HessionRmiServerConfig {

	@Autowired
	@Qualifier("hessianUserService")
	private IHessianUserService hessianUserService;
	
	@Bean("/hessianUserService")
	public HessianServiceExporter hessianExporter() {
		HessianServiceExporter exporter = new HessianServiceExporter();
		exporter.setService(hessianUserService);
		exporter.setServiceInterface(IHessianUserService.class);
		return exporter;
	}

}
